#include "stdafx.h"
#include <MyControls/ZoomOut.h>
#include <MyControls/Resource.h>
#include <MyControls/App.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

namespace My {

ZoomOut::ZoomOut()
	: GlyphButton("ZoomOut", "ZoomOutMask"), m_pView(0)
{
	SetEnabled(false);
}

String ZoomOut::Hint() const 
{
	return GetApp().LoadString(IDS_ZOOM_OUT); 
}

void ZoomOut::SetView(ZoomView * pView)
{
	if (pView != m_pView) {
		m_pView = pView;
		SetEnabled(m_pView != 0);
	}
}

void ZoomOut::HandleClick()
{
	if  (m_pView == 0)
		return;
	m_pView->ZoomBy(.5f);
}

} // My